//
//  SubmitTailView.m
//  WE
//
//  Created by 要帅气的生活 on 15/11/24.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "SubmitTailView.h"

@implementation SubmitTailView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _buttonSubmit  = [UIButton buttonWithType:UIButtonTypeSystem];
        _buttonSubmit.frame = CGRectMake(10 , 10, self.frame.size.width-20, self.frame.size.height/2);
        //设置按钮上的文字
        [_buttonSubmit setTitle:@"提交" forState:UIControlStateNormal];
        //设置按钮点击事件
        [_buttonSubmit addTarget:self action:@selector(submit) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_buttonSubmit];
        _buttonSubmit.backgroundColor = [UIColor blueColor];
        _buttonSubmit.tintColor = [UIColor whiteColor];
        
        _buttonUnderstand  = [UIButton buttonWithType:UIButtonTypeSystem];
        _buttonUnderstand.frame = CGRectMake(10 , self.frame.size.height/2+16, 16, 16);
        //设置按钮图片
        [_buttonUnderstand setBackgroundImage:[UIImage imageNamed:@"gou.png"] forState:UIControlStateNormal];

        //设置按钮点击事件
        [_buttonUnderstand addTarget:self action:@selector(understand:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_buttonUnderstand];
        
        _label = [[UILabel alloc] initWithFrame:CGRectMake(36, self.frame.size.height/2+16, self.frame.size.width/11*2, 16)];
        _label.font = [UIFont systemFontOfSize:13];
        _label.text = @"我已经了解";
        [self addSubview:_label];
        
        _buttonInstructions  = [UIButton buttonWithType:UIButtonTypeSystem];
        _buttonInstructions.frame = CGRectMake(self.frame.size.width/11*2 + 42 , self.frame.size.height/2+16, self.frame.size.width/5*2, 12);
        //设置按钮上的文字
        [_buttonInstructions setTitle:@"《微医快约申请须知》" forState:UIControlStateNormal];
        //设置按钮点击事件
        [_buttonInstructions addTarget:self action:@selector(Instructions) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_buttonInstructions];
        _buttonInstructions.titleLabel.font = [UIFont systemFontOfSize:13];
        _buttonInstructions.tintColor = [UIColor blueColor];
        
    }
    return self;
}

-(void)submit{
    NSLog(@"提交");
}
-(void)understand:(UIButton *)button{
    NSLog(@"是否勾选");
}
-(void)Instructions{
    NSLog(@"微医快约申请须知");
}
@end
